#!/bin/bash

rm files/*
rm upload/*

mysqldump -hvega.mtw.ru -useadesign2 -p6U6keLu0 --character-sets-dir="C:\Program Files\MySQL\MySQL Server 5.1\share\charsets" --default-character-set=cp1251 db_seadesign2 > dump.sql
mysql -b -uroot -pr00t -Dseadesign --character-sets-dir="C:\Program Files\MySQL\MySQL Server 5.1\share\charsets" --default-character-set=cp1251 < dump.sql

ftp -n -i vega.mtw.ru <<!
	QUOTE USER seadesign
	QUOTE PASS puspuspus
	binary
	cd html
	lcd files
    mget files/*
	lcd upload
	mget upload/*
	bye
!

rm dump.sql
